package Plate;

import javax.swing.*;
import java.awt.*;
import java.util.ArrayList;

public class Text extends JFrame {
    public Text() {
        Doudizhu doudizhu = new Doudizhu();
        doudizhu.init();
        doudizhu.xipai();
        doudizhu.fapai();
        this.setLayout(null);
        int y = 500;
        for (int i = 0; i < 17; i++) {
            ImageIcon image = Util.getIcon("/images/" + doudizhu.getPlayer1().get(i) + ".jpg");
            JLabel jLabel = new JLabel(image);
            jLabel.setBounds(10, y, 105, 150);
            this.add(jLabel);
            y -= 30;
        }
        int a=500;
        for (int i = 0; i < 17; i++) {
            ImageIcon image = Util.getIcon("/images/" + doudizhu.getPlayer2().get(i) + ".jpg");
            JLabel jLabel = new JLabel(image);
            jLabel.setBounds(665, a, 105, 150);
            this.add(jLabel);
            a -= 30;
        }
        int b=575;
        for (int i = 0; i < 17; i++) {
            ImageIcon image = Util.getIcon("/images/" + doudizhu.getPlayer3().get(i) + ".jpg");
            JLabel jLabel = new JLabel(image);
            jLabel.setBounds(b, 650, 105, 150);
            this.add(jLabel);
            b -= 30;
        }
        int c=375;
        for(int i=0;i<3;i++){
            ImageIcon image = Util.getIcon("/images/" + doudizhu.getBase().get(i) + ".jpg");
            JLabel jLabel = new JLabel(image);
            jLabel.setBounds(c, 0, 105, 150);
            this.add(jLabel);
            c -= 30;
        }

        this.setSize(800, 800);
        this.setLocationRelativeTo(null);
        this.setTitle("哈喽");
        this.setDefaultCloseOperation(EXIT_ON_CLOSE);
        this.setVisible(true);
    }

    public static void main(String[] args) {

        new Text();
    }
}
